home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / da / clipmagi.sit / About Clipboard Magician next >
Text File  |  1989-06-01  |  11KB  |  77 lines

  1. About Clipboard Magician 0.55, 89-6-1.
  2.  
  3. In view of what has been happening in China, I am dedicating this program to all those who are fighting for democracy in China.
  4.  
  5. There is only minor modification of the DA from version 0.5 to 0.55. The change is made mainly so that an operation can now return a list of data rather than a single piece of data. The visiable change to the DA is that now the number of bytes in the data selected is displayed. If an operation has failed, an error number is also displayed (of course this will be change to error message in future).
  6.  
  7. The major change is more new components have been added. Now there are over 40 components with a total size of 87K. I shall give a list of all the components.
  8.  
  9. Convert ICON to PICT.
  10. Convert PICT to ICON.
  11. Convert CURS to PICT.
  12. Convert PICT to ICON.
  13. Reduce PICT to its edge.
  14. Convert PICT to SICN - from PICT to 16x16 bit map.
  15. Convert MWRT to TEXT - MacWrite data to plain text.
  16. Change carriage return in text to space.
  17. Remove line feed character from text.
  18. Save a PICT as PICT file.
  19. Read Text file into scrap.
  20. Read PICT file into scrap.
  21. Hexdump the data.
  22. Get file info.
  23. Convert STR to TEXT.
  24. Convert ICN# to PICT.
  25. Play a snd  resource sound.
  26. Rename the data type.
  27. Print a PICT.
  28. Print the TEXT; hold down option key to change font and size.
  29. Edit the text - function is about that of TeachText; hold down option key to change font and size.
  30. Read data fork of a file into scrap.
  31. Consider ICN# to be a list of icons and pick an icon out of the list.
  32. Read a resource from a file into the scrap.
  33. Save data as resource in an existing file.
  34. Pack hexdecimal digits.
  35. Save data into the data fork of a new file.
  36. Sort text lines.
  37. Append data to the data fork of an existing file.
  38. Read a MacPaint file into scrap as PICT.
  39. Select an area out of a PICT.
  40. Transliterate text - See inside Mac, vol 5, p311.
  41. Convert HyperCard card fields and buttons into a dialog item list DITL.
  42. Replace text string, uses Grep library from Capps'¬ of Think Technologies Inc.
  43. Rotate SICN the 16 by 16 bit map.
  44. Rotate ICON the 32 by 32 bit map.
  45. Rotate ICN#, a list of icons.
  46. Convert Shifted GB code Chinese character to GB code.
  47. Convert GB code to Shifted GB code Chinese character.
  48. Edit big text data that has no need of wrap around, uses PEEdit library from Capps'¬ of Think Technologies Inc. Hold down option key to change font and size
  49. Generate some text and put it into scrap.
  50. Convert dialog item list DITL to view resource for use in MACAPP 2.0.
  51. Convert dialog item list DITL to a HyperCard card.
  52. Edit data according to a template, template is in same format as that of ResEdit. Read ResEdit manual for more details. There is also an extension to the template types. BBYT is boolean in a single byte. ATPX where x is '0'-'9' is align to the power. So ATP5 means align to the 2 ** 5 = 32 bytes, and 0 is treated as 10. No editing allowed if size of data is large. Hold down option key if you want to edit without a template (edit the hex dump).
  53.  
  54. ----------------------------------
  55. About Clipboard Magician 0.5, 89-4-6.
  56.  
  57. The Clipboard Magician is a prototype written to explore certain concepts. I have worked on and off on the project, never quite finishing it.  However I have been using it myself daily without serious problem. I feel even in its present form it can be useful to many users. So I am releasing it as freeware. You may copy it and use it freely, but it may not be redistributed as a commercial product. Apple computer Inc. retains the copyright. NOTE THAT THIS IS NOT AN OFFICIALLY RELEASED PRODUCT FROM APPLE COMPUTER INC SO DO NOT EXPECT IT TO HAVE THE QUALITY AND ROBUSTNESS YOU NORMALLY EXPECT FROM PRODUCTS FROM APPLE COMPUTER INC., NOR EXPECT ANY SUPPORT ON THIS PROGRAM FROM APPLE COMPUTER INC.
  58.  
  59. The Clipboard Magician is a desk accessory that displays the scrap. It is just like a clipboard but it also allows you to manipulate the data there. The basic concept is that application should not be required to copy multiple representation to the scrap. Rather an application can copy the most meaningful information to the scrap, and tools can be used to transform it to other desired form. The Clipboard Magician cannot pull a rabbit out of the clipboard, but if you put an ICON into it, you can pull a PICT out of it. That is why it is called Clipboard Magician. (Earlier I have used the name Alchemist, the theme is similar). If you have copied an ICON using ResEdit, the current Finder Clipboard will not show it, neither will the scrapbook. However the Clipboard Magician would just transform it into a picture and show it.
  60.  
  61. Of course we would need more tools as new data type are introduced. Hence there is no fixed set of tools. Rather the tools are software components - XCMD like code resource - that are installed into a file called "Magic Wand" that should be placed in the system folder. So if you need to display a CURS, you need to get a CURS to PICT components. As needs arises, I have written a number of components for my own use. They are written in a quick and dirty manner (some are written in a few minutes) and certainly nothing worth bragging about individually. Do not judge the concept of the Clipboard Magician by the quality of component tools available here. They are no more than examples hinting what can be done. Hopefully better versions will be written and since they are components they can be replaced any time. Collectively they still represent a useful collection of tools that is available to the user anytime. This is especially useful if you are not running MultiFinder. I interpret the word conversion very broadly. PICT to ICON and ICON to PICT obviously are conversions. Removing line feeds from text data is also a conversion. So are text editing, text printing, picture printing, saving scrap data to file (either data fork or resource), reading data (either data fork or resource) into scrap (so you can hunt for ICONs from various applications), read a PICT/PAINT file to scrap, get file information, do a hex dump, undo a hex dump, play a 'snd ', all available from a single DA. And if you are willing to  program the component or someone else is doing it, it can be added to the list.
  62.  
  63. Install the Clipboard Magician DA and put the file "Magic Wand" into the system folder and you are ready to use it. When you open Clipboard Magician DA, there will be a list of all the data in the scrap, the data type is on the list so that you know what you are looking at. The main frame of the DA doubles as the clipboard view and command list, the default being the clipboard view. The two views can be toggled using the menu command Show Command/Show Clipboard View. A mouse click on the clipboard view also toggles it to the command view. If there are multiple data on the scrap, the view is selected by the selection in the list on the left. The commands also depend on the data type selected since different set of commands are available for different data types. If no data type is selected (this can also be done by selecting "generate new data" from the menu), then the command list will be those that generate data rather than operate on data, e.g. read MacPaint file into scrap. There is a check box on the DA to control whether picture will be shown as actual size or scaled to fit. Even in the background the DA would check for new content in the scrap periodically. So for an application that does not implement a clipboard and copies directly to the public scrap rather than keeping a private scrap, you can use the Clipboard Magician as a substitute clipboard. However to do this you should launch Clipboard Magician in the application partition under multifinder. One example is ResEdit. ResEdit copies to the public scrap, does not have a clipboard,  and does not generate extra PICT scrap data when ICON, CURS etc are copied. The Clipboard Magician would work nicely here as a clipbboard. If the Clipboard Magician is present in every system, no future application needs to implement a clipboard of its own.
  64.  
  65. When a command is selected, if the About this operation menu item is enabled, you can find out more about the command. To execute the command, you hit the "Do it" button (or double click on the command, or hit the return key). Normally the scrap will be cleared and the scrap will contain the new converted data. This can be changed by the checkbox so that the new data will be appended to the end of scrap. There are a few commands, like the text editor, that use certain default parameters (Font and size in this example). If you want to change the default, you should hold down the option key when you invoke the command.
  66.  
  67. There is currently no installer program for the components, so you have to use ResEdit to put it into file "Magic Wand" (I think you can even use the Clipboard Magician tools to do it if you are brave enough). The components are either of resource type CNVT or XRTN where the former are visible to the user and the latter is not accessible directly but may be used by the CNVT components. By convention the resource IDs are multiple of 32 and components with resource ID N would own all the resource with ID between N and N+31 (is that too few or too many?). The resource name of CNVT has to follow certain convention so be careful when you try to translate it into a foreign language. The first four byte is the data type that the command can operate on (or ____ if it does not operate on any data, or **** if can operate on any kind of data as in the case of hexdump). If the fifth byte is '>' followed by four more bytes, then it is a data conversion component and should not be renamed. Otherwise the rest is just the command name and you can change or translate it. However some of the components may be called by other components by name (in particular the text and pict printing components are called by the Clipboard Magician to print the clipboard), changing the name may make other components fail.
  68.  
  69. In a sense the paradigm is a pseudo-object-oriented approach where the data type is the class, '****' is the superclass. You select an object and the methods (including those inherited from the superclass) are presented. It is a nice paradigm. However there are newer applications that paste different types of data to the scrap where one is the supplement of the other. An example is 'styl'. Then the current paradigm breaks down. Fortunately they are comparatively rare. Actually this comes about because the convention of writing multiple sets of data to the scrap is wasteful and this is used as a way of getting around the problem. This won't be necessary if we follow the Clipboard Magician paradigm where application just write out the richest data type, and the Clipboard Magician would convert it to a form acceptable by other applications.
  70.  
  71. The Clipboard Magician requires the 128K ROM. The DA is about 10K. The current magic wand file is 31K and contains 30 components, only a few needs to be in memory at the same time. There is a separate document on how to program CNVTs.
  72.  
  73. Send bug report or comments or new components to
  74. Ed Lai
  75. lai@apple.com
  76. AppleLink: Lai1
  77.